package so.sao.code.service.infrastructure.enums;

import so.sao.top.core.util.enums.NamedEnumEntity;

/**
 * Created by Administrator on 2017/6/28.
 */
public enum TAG_BATCH_STATUS implements NamedEnumEntity<Integer> {
    UNACTIVATE(10, "未激活"), PORTION_ACTIVATE(30, "部分激活"), ACTIVATED(20, "已激活");

    private Integer value;

    private String name;

    TAG_BATCH_STATUS(Integer value, String name) {
        this.name = name;
        this.value = value;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getName() {
        return name;
    }

    public static TAG_BATCH_STATUS fromValue(Integer value) {
        switch (value) {
            case 10:
                return TAG_BATCH_STATUS.UNACTIVATE;
            case 20:
                return TAG_BATCH_STATUS.ACTIVATED;
            case 30:
                return TAG_BATCH_STATUS.PORTION_ACTIVATE;
            default:
                return TAG_BATCH_STATUS.UNACTIVATE;
        }
    }
}
